package com.wenli.graduate2022.wenliGreenShop.service.servImpl;

import com.wenli.graduate2022.wenliGreenShop.entity.ProductOrderItem;
import com.wenli.graduate2022.wenliGreenShop.repository.mapper.ProductOrderItemMapper;
import com.wenli.graduate2022.wenliGreenShop.service.servDao.ProductOrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author HuangHai
 * @date 2021/10/13 16:25
 */
@Service
public class ProductOrderItemServImpl implements ProductOrderItemService {

    @Autowired
    ProductOrderItemMapper productOrderItemMapper;


    @Override
    public List<ProductOrderItem> findByProductId(Integer productId) {
        return productOrderItemMapper.findByProductId(productId);
    }

    @Override
    public List<ProductOrderItem> findByOrderId(Integer id) {
        return productOrderItemMapper.findByOrderId(id);
    }

    @Override
    public ProductOrderItem findById(Integer id) {
        return productOrderItemMapper.findById(id);
    }

    @Override
    public List<ProductOrderItem> findByUserId(Integer id) {
        return productOrderItemMapper.findByUserId(id);
    }

    @Override
    public int insert(ProductOrderItem productOrderItem, String productId, String userId) {
        return productOrderItemMapper.insert(productOrderItem,productId,userId);
    }
}
